<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Jeu De Role:  Fichier source de projetrpg/include/Carte.h</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Jeu De Role
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Généré par Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Recherche');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_carte_8h.html','');
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tout</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Fichiers</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Fonctions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">projetrpg/include/Carte.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_carte_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __CARTE__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __CARTE__</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;../include/Heros.h&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="keyword">class </span><a class="code" href="class_heros.html" title="classe representant un heros">Heros</a>;
<a name="l00008"></a>00008 <span class="comment">/*</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">La carte est un tableau 2D d&#39;entier dont la valeur indique le type de terrain.</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment"></span>
<a name="l00013"></a>00013 <span class="comment">0: case vide, non initialiser. N&#39;est utile que pour ne pas avoir à initialiser les cases qui n&#39;aparaissent pas</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">Terrains franchissables:</span>
<a name="l00016"></a>00016 <span class="comment"></span>
<a name="l00017"></a>00017 <span class="comment">Valeurs comprises entre 1 et 20 inclus.</span>
<a name="l00018"></a>00018 <span class="comment">1: herbe</span>
<a name="l00019"></a>00019 <span class="comment">2: sol de pierre</span>
<a name="l00020"></a>00020 <span class="comment">3: terre</span>
<a name="l00021"></a>00021 <span class="comment">4: sable</span>
<a name="l00022"></a>00022 <span class="comment"></span>
<a name="l00023"></a>00023 <span class="comment">Terrains infranchissable</span>
<a name="l00024"></a>00024 <span class="comment"></span>
<a name="l00025"></a>00025 <span class="comment">Valeurs au dessus ou égale à 21.</span>
<a name="l00026"></a>00026 <span class="comment"></span>
<a name="l00027"></a>00027 <span class="comment">21: eau</span>
<a name="l00028"></a>00028 <span class="comment">22: lave</span>
<a name="l00029"></a>00029 <span class="comment">23: rocher</span>
<a name="l00030"></a>00030 <span class="comment">24: mur</span>
<a name="l00031"></a>00031 <span class="comment"></span>
<a name="l00032"></a>00032 <span class="comment">*/</span>
<a name="l00033"></a>00033 
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 
<a name="l00047"></a><a class="code" href="class_carte.html">00047</a> <span class="keyword">class </span><a class="code" href="class_carte.html" title="Gère les différentes fonctions de la carte.">Carte</a>
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049     <span class="keyword">public</span>:
<a name="l00050"></a>00050 
<a name="l00055"></a>00055         <a class="code" href="class_carte.html#a995cfaff1efea0015b511faa107d51b9" title="Constructeur.">Carte</a> (<span class="keywordtype">char</span> nom_fichier[]);
<a name="l00056"></a>00056 
<a name="l00061"></a>00061         <span class="keyword">virtual</span> <a class="code" href="class_carte.html#a63300ff55c58b5d5b1674a3fc8f25910" title="Destructeur. Vide le tableau dynamique qu&#39;est la carte.">~Carte</a> ();
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 
<a name="l00068"></a>00068         <span class="keywordtype">void</span> <a class="code" href="class_carte.html#a3d350245283f7321daa81d5255980147" title="Charge dans le tableau dynamique le contenu du fichier dont le nom est passé en paramètre.">ini_carte</a> (<span class="keywordtype">char</span> nom_fichier[]);
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 
<a name="l00077"></a>00077         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#a4eb892e7bfccbecf70a99ca4406e9be3" title="Renvoie un entier qui indique le type de terrain situé dans la case passé en paramètre.">recup_case</a> (<span class="keywordtype">int</span> dimx, <span class="keywordtype">int</span> dimy);
<a name="l00078"></a>00078 
<a name="l00083"></a>00083         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#aa3994f5dd451cacc1119c63ad28063fd" title="Renvoie la largeur de la carte.">recup_xmax</a> ();
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 
<a name="l00090"></a>00090         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#ae3e7ed3ccb053e940b9081767dd8e2a4" title="Renvoie la hauteur de la carte.">recup_ymax</a>();
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 
<a name="l00099"></a>00099         <span class="keywordtype">bool</span> <a class="code" href="class_carte.html#a7f706129494bf828fd51c757e65aa56b" title="Renvoie un bolléen si la case passé en paramètre peut être franchise.">case_franchissable</a> (<span class="keywordtype">int</span> dimx, <span class="keywordtype">int</span> dimy);
<a name="l00100"></a>00100 
<a name="l00104"></a>00104         <span class="keywordtype">void</span> <a class="code" href="class_carte.html#a6272511773ffca44ab9e0ca78f944d4e" title="Test de régression de la carte.">test_reg</a>();
<a name="l00105"></a>00105 
<a name="l00111"></a>00111         <span class="keywordtype">bool</span> <a class="code" href="class_carte.html#ab31009532a48f51b294d4f463850562d" title="Renvoie un boléen qui indique si un combat a lieu.">si_combat</a>(<span class="keywordtype">bool</span> reinitialise = <span class="keyword">false</span>);
<a name="l00112"></a>00112 
<a name="l00119"></a>00119         <span class="keywordtype">void</span> <a class="code" href="class_carte.html#a189b5be18fa354fc0dc4fbbe8a91c19d" title="Place le héros sur la carte.">positionne_heros</a>(<a class="code" href="class_heros.html" title="classe representant un heros">Heros</a> *p_heros, <span class="keywordtype">int</span> p_x, <span class="keywordtype">int</span> p_y);
<a name="l00120"></a>00120 
<a name="l00126"></a>00126         <span class="keywordtype">bool</span> <a class="code" href="class_carte.html#a8fb200f269c3ed756f447c5ea3245eaa" title="Déplace le héros sur la Carte.">deplacer_heros</a>(<span class="keywordtype">int</span> p_vect_x, <span class="keywordtype">int</span> p_vect_y);
<a name="l00127"></a>00127 
<a name="l00131"></a>00131         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#a5aefa41a1da7a1f76d67d632a67b99ca" title="Recup la case ou se situe le héros.">recup_case_heros</a>();
<a name="l00132"></a>00132 
<a name="l00133"></a>00133     <span class="keyword">private</span>:
<a name="l00134"></a><a class="code" href="class_carte.html#a3ee91a39306ef8aa42ccfc2203d59e9e">00134</a>         <span class="keywordtype">int</span> ** <a class="code" href="class_carte.html#a3ee91a39306ef8aa42ccfc2203d59e9e">ma_carte</a>;    
<a name="l00135"></a>00135 
<a name="l00136"></a>00136 
<a name="l00137"></a>00137 
<a name="l00138"></a>00138 
<a name="l00139"></a>00139         <span class="keywordtype">void</span> <a class="code" href="class_carte.html#a02e25cc53f9f815db78d4382d5a3eec4" title="Créer le tableau dynamique qui sera utilisé pour stoquer la carte.">ini_tableaudy</a>();
<a name="l00140"></a>00140 
<a name="l00145"></a>00145         <span class="keywordtype">void</span> <a class="code" href="class_carte.html#ad6bf6922b792cfbd10ff30b4d89baea0" title="Récupère xmax et ymax.">def_xymax</a> (<span class="keywordtype">char</span> nom_fichier[]);
<a name="l00146"></a>00146 
<a name="l00150"></a>00150         <span class="keywordtype">void</span> <a class="code" href="class_carte.html#a7fb84e56327493cf605d26c9b3ac92b5" title="initilise le tableau dynamique à zéro.">init_a_zero</a>();
<a name="l00151"></a>00151 
<a name="l00152"></a><a class="code" href="class_carte.html#aef002a4dcef4387aa4f67cf4b962aa20">00152</a>         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#aef002a4dcef4387aa4f67cf4b962aa20" title="longueur max du tableau">xmax</a>;        
<a name="l00153"></a>00153 
<a name="l00154"></a><a class="code" href="class_carte.html#affb3c0a61e8d8317fb65635ab82bbf52">00154</a>         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#affb3c0a61e8d8317fb65635ab82bbf52" title="hauteur max du tableau">ymax</a>;        
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 
<a name="l00159"></a><a class="code" href="class_carte.html#a40986aec195d3f1e534d1321806b2bd9">00159</a>         <span class="keywordtype">int</span> <a class="code" href="class_carte.html#a40986aec195d3f1e534d1321806b2bd9" title="Contient la probabilité de tomber sur un combat.">proba_combat</a>;   
<a name="l00160"></a>00160 
<a name="l00161"></a><a class="code" href="class_carte.html#a1f89959db7ebb8a739583e56a8e3b8f9">00161</a>         <a class="code" href="class_heros.html" title="classe representant un heros">Heros</a>* <a class="code" href="class_carte.html#a1f89959db7ebb8a739583e56a8e3b8f9" title="Pointeur sur le héros.">chef_equipe</a>; 
<a name="l00162"></a>00162 };
<a name="l00163"></a>00163 
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_carte_8h.html">Carte.h</a>      </li>

    <li class="footer">Généré le Jeudi Juin 7 2012 14:15:52 pour Jeu De Role par
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0 </li>
   </ul>
 </div>


</body>
</html>
